#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;

int main() {
    int n;
    cin >> n;
    cout << 2 << endl;
    bool flag;
    for(int i = 3; i <= n; i+=2){
        flag = 1;
        for(int j = 3; j < i; j++){
            if(i%j == 0){
                flag = 0;
            }
        }
        if(flag){
            cout << i << endl;
        }
    }
    return 0;
}